using System.IO;
using Beaker.FileSystem;

namespace OpenCube.IO.Specs.Helpers
{
	public static class FileExtensions
	{
		public static void WriteText(this IFile file, string text)
		{
			using (var stream = file.OpenWrite())
			{
				var writer = new StreamWriter(stream);
				writer.WriteLine(text);

				writer.Flush();
				stream.Flush();
				stream.Close();
			}
		}
	}
}